package com.vows.environment;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

/**
 * Created by jazzy-zhao on 2017/7/12.
 * @description: 开发环境配置
 */

//@Configuration
public class DevlopmentConfigProfile {

    /**
     * @description 数据库配置，直接使用JDBC驱动
     * @return
     */
    @Bean
    @Profile("devConfig")
    public DataSource devDataSource(){
        DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
        PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
        propertyPlaceholderConfigurer.setIgnoreResourceNotFound(true);

//  /      driverManagerDataSource.setConnectionProperties();

        return null;
    }
    @Profile("prodConfig")
    public DataSource proDataSource(){
        return null;
    }

    @Profile("qaConfig")
    public DataSource qaDataSource(){
        return null;
    }
}
